package com.zl.roomdesignserver.controller;

import com.zl.roomdesignserver.entity.auth.User;
import com.zl.roomdesignserver.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhangli on 2018/5/5 13:59.<br/>
 */
@RestController
public class AuthController {

    @Autowired
    AuthService authService;

    @PostMapping("/auth/login")
    public Object login(@RequestBody User user) {
        return authService.login(user);
    }

    @PostMapping("/auth/register")
    public Object register(@RequestBody User user) {
        return authService.register(user);
    }
}
